import '../utils/api/http.dart';
import '../utils/tools/localstorage_tool.dart';
import '../bean/envmonitoring_bean.dart';

class EnvMonitoring {

  /// 获取环境监测
  /// * [par] Map|必填|台区id
  static Future reqEnvMonitoringInfo(par) async {
    String token = await LocalStorage.getStringItem("token");
    var res = await HttpManager.getInstance().get("environmentData/getNewestPmEnvironmentData?token=${token}", params: par);
    //print(res);
    if(res["data"] != null){
      return EnvmonitoringBean.fromJsonList(res["data"]);
    } else {
      return null;
    }
  }
}
